#!/bin/bash

lists=( $(find -name kpc-apt-purge-all-pkgs.sh | awk '{split($0,a,":"); print a[1]}') )
for i in $( seq 0 $((${#lists[*]} - 1)) )
do
  echo "lists[$i]=${lists[$i]}"
  real_path=$( realpath ${lists[$i]} )
  real_dir=$( dirname $real_path )
  real_path_new=$real_dir/kpc-apt-purge-all-removed-pkgs.sh
  echo "mv -f $real_path $real_path_new"
  #mv -f $real_path $real_path_new
  dir_name=$( dirname ${lists[$i]} )
  new_path=$dir_name/kpc-apt-purge-all-removed-pkgs.sh
  echo "git mv ${lists[$i]} $new_path"
  git mv ${lists[$i]} $new_path
  #git rm ${lists[$i]}
  #git add ${lists[$i]}
done
